import 'package:flutter/material.dart';
import 'package:learn/components/mcourseItem.dart';
import 'package:learn/components/headerDate.dart';

class IndexList extends StatefulWidget {
  @override
  _IndexListState createState() => _IndexListState();
}

class _IndexListState extends State<IndexList>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return _ListItem();
  }

  @override
  bool get wantKeepAlive => true;
}

class _ListItem extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: 5,
      itemBuilder: (_, index) {
        if (index == 0) {
          return HeaderDate();
        } else {
          return McourseItem('副标题', '让真情自然流露的写作秘密','https://img3.mukewang.com/szimg/5d919e87087c044201400140-140-140.jpg');
        }
      },
    );
  }
}
